﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BO;
using BLL;

namespace MvcApplication1.Controllers
{
    public class AccountsController : Controller
    {
        public ActionResult Index()
        {
            var accounts = Accounts.Get().Select();
            return View(accounts);
        }

        public ActionResult PostInspection()
        {
            var accountPosts = Accounts.Get()
                                    .Join(Posts.Get(), Posts.Columns.AccountID)
                                    .Select();

            var pages = FBPages.Get()
                                    .Join(Posts.Get(), Posts.Columns.PageID)
                                    .Select();

            ViewBag.Pages = pages;

            return View(accountPosts);
        }

    }
}
